package com.lm.artemis.controller;

import com.lm.artemis.producer.MsgProducer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    private final MsgProducer producer;

    public TestController(MsgProducer producer) {
        this.producer = producer;
    }

    @GetMapping("/send")
    public String sendMsg(String msg) {
        producer.send(msg);
        return "消息已发送: " + msg;
    }
}